package simple3D.materials 
{
	import flash.display.BitmapData;
	import flash.display.Graphics;
	/**
	 * ...
	 * @author Dmitriy Gaiduk
	 */
	public class BitmapMaterial extends Material3D
	{
		private var _texture:BitmapData;
		public var repeatTexture:Boolean = false;
		public var smooth:Boolean = true;
		public function BitmapMaterial(bitmap:BitmapData, repeatTexture:Boolean = false) 
		{
			_texture = bitmap;
			this.repeatTexture = repeatTexture
		}
		
		
		override public function drawTriangles(gr:Graphics, vertices:Vector.<Number>, indices:Vector.<int>, 
										uvt:Vector.<Number>, triangleCulling:String):void 
		{
			gr.beginBitmapFill(_texture,null,false,true);
			gr.drawTriangles(vertices, indices, uvt, triangleCulling);
		}
		
		/*override public function beginFill(gr:Graphics):void 
		{
			gr.beginBitmapFill(_texture);
		}*/
		
	}

}